import request from "./request";
// 服务列表说明
export interface IpolicyItem {
    innerTitle: any,
    id: number | string,
    outerTitle: any,
    text?: string,
    title: string,
    content: string,
    url?: string,
}
// 广告横幅-轮播
interface IadBanners {
    picUrl: string,
    targetUrl: string,
    extra: {}
}
// 横幅价格栏目4
export interface IfinalPrice {
    prefix: string |number,
    price: string |number,
    suffix: any
}
// 横幅价格栏目3
export type IpriceInfo = {
    finalPrice: IfinalPrice,
    counterPrice: any,
    basicPrice: string
}
// 横幅价格栏目2
export type IprocessBanner = {
    title: string,
    supplementText: string | null,
    priceInfo: IpriceInfo,
    timePrefix: string | null,
    endTimeGap: number | null,
    logoUrl: string,
    iconUrl: string | null,
}
// 横幅价格栏目1
export type Ibanner2 = {
    status: number,
    preBanner: any,
    processBanner: IprocessBanner,
    type: number,
}

// 商品数据总汇数据
export type IdetailsDataitem = {
    id: number | string,
    listPicUrl: string,
    name: string,
    seoTitle: any,
    simpleDesc: string,
    primaryPicUrl: string,
    primarySkuId: number | string,
    retailPrice: number | string,
    counterPrice: number | string,
    sortOriginPrice: any,
    status: number | string,
    updateTime: number | string,
    itemDetail: {
        detailHtml?: string,
        picUrl1?: string,
        picUrl2?: string,
        picUrl3?: string,
        picUrl4?: string,
        picUrl5?: string,
        picUrl6?: string,
        picUrl7?: string,
        videoInfo?: {}
    }
    // 选择型号重新渲染页面的数据
    skuList: [],
    // 产品参数
    attrList: [],
    // 库存 价格图片
    skuMap: [],
    // 选择产品列表
    skuSpecList: [],
    // 销售量
    sellVolume: number | string,
    // 常见问题数据列表
    issueList: [],
    // 评论列表
    comments: [],
    // 活动类型描述
    promotionDesc: string,
    // 特征列表
    characteristicList: [],
    // 广告横幅-轮播
    adBanners: IadBanners[],
    //项目限制
    itemLimit: string,
    // 好评率
    goodCmtRate: string,
    // 购物返
    shoppingReward: {},
    // 购物返详情弹出
    shoppingRewardRule: {},
    // 推荐理由
    recommendReason: [],
    // 运费
    skuFreight: {},
    // 品牌信息
    brandInfo: {},
    // 简单品牌信息
    simpleBrandInfo: {},
    // 简易价格数据
    price: {},
    // 横幅价格栏目
    banner: Ibanner2,
}
// 获取数据
export type IgoodsDetailsData = {
    indicator: any,
    item: IdetailsDataitem,
    itemType: number | string,
    YXJSONObject: any,
    giftcardRealNameAuthAmount: number | string,
    policyList: IpolicyItem[],
    YXJSONArray: any,
    global: any,
    source: number | string,
    commentWithPicCount: number | string,
    commentCount: number | string,
}

export default {
    // 专门获取单个商品详情的请求
    getGoodsDetailsData(Id: number | string) {
        return request.get<any, IgoodsDetailsData>(`item/detail.json?id=${Id}`)
    }
}


